# %%
# !pip install --upgrade paddlenlp -i https://mirror.baidu.com/pypi/simple
# pip install setuptools_scm
#  pip install -r requirements.txt --use-feature=2020-resolver  -i https://mirror.baidu.com/pypi/simple
# %%
import paddlenlp
from paddlenlp.embeddings import TokenEmbedding

# 初始化TokenEmbedding， 预训练embedding未下载时会自动下载并加载数据
token_embedding = TokenEmbedding(embedding_name="w2v.baidu_encyclopedia.target.word-word.dim300")

# 查看token_embedding详情
print(token_embedding)
# %%
token_embedding.search("沐沐造型")
# %%
token_embedding.search("理发店")
# %%
token_embedding.cosine_sim("沐沐造型", "理发店")
# %%
